<template>
  <div ref="table">
    {{ msg }}
    <TestA v-if="flag"></TestA>

    <button @click="flag = !flag">销毁子组件</button>
  </div>
</template>
 
<script>
import TestA from './TestA.vue'
export default {
  data() {
    return {
      msg: '123',
      flag: true
    }
  },
  components: {
    TestA
  }
}
</script>

<style scoped>
</style>